package com.hnyc.controller;

import com.hnyc.domain.AjaxResult;
import com.hnyc.domain.CandUserRole;
import com.hnyc.service.ICandUserRoleService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @Author: XieYingHao
 * @date: 2023/7/1 11:01
 */
@RestController
@RequestMapping("/cand/userRole")
public class CandUserRoleController {

    @Resource
    private ICandUserRoleService candUserRoleService;

    /**
     * 绑定用户角色
     */
    @PostMapping
    public AjaxResult add(@Validated @RequestBody CandUserRole userRole) {
        return candUserRoleService.insertUserRole(userRole) > 0 ? AjaxResult.success() : AjaxResult.error();
    }


}
